
project(OLDataBase)

# 收集源文件
file(GLOB_RECURSE SRC_FILES 
    "*.cpp" 
    "*.cxx" 
    "*.cc"
    "*.hpp" 
    "*.h"
)

# 创建共享库
add_library(OLDataBase SHARED ${SRC_FILES})

# 仅在 Windows 下定义导出宏
if(WIN32)
    target_compile_definitions(OLDataBase PRIVATE DATABASE_API)
endif()

# 查找Qt依赖
find_package(Qt5 COMPONENTS Widgets Core Gui REQUIRED)

# 添加依赖项
target_link_libraries(OLDataBase 
    PRIVATE 
    Qt5::Widgets
    Qt5::Core
    Qt5::Gui
    OLCore
    ${THIRD_PARTY_LIBS}
)

# 添加头文件目录
target_include_directories(OLDataBase 
    PUBLIC 
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_SOURCE_DIR}/src/OLCore
)

